import { stringify } from 'qs';
import request from '@/utils/request';

export interface ProjectTreeType {
  projectId: string;
}

export interface ListByShortNameParamsType {
  projectShortname: string;
}

/**
 * 获取项目结构树
 * @export
 * @param {number} projectId 默认为0
 * @returns
 */
export async function queryProjectTree(params: ProjectTreeType) {
  return request(`/ProjectStructure/findTree?${stringify(params)}`);
}

/** 列表查询根据shortName获取相关信息 */
export async function querylistByShortName(params: ListByShortNameParamsType) {
  return request(`/Eps/listByShortName?${stringify(params)}`);
}

/** 根据附件Id获取附件地址 */
export async function getAttachmentContent(id: string | number) {
  return request(`/attachment/getAttachmentContent/${id}`, { method: 'POST' });
}
